Skip to content

Fix crash on command substitution containing a sourced file#3487

Open
SAY-5 wants to merge 1 commit into
koalaman:masterfrom
SAY-5:fix-checkcmd-non-exhaustive
Open

Fix crash on command substitution containing a sourced file#3487
SAY-5 wants to merge 1 commit into
koalaman:masterfrom
SAY-5:fix-checkcmd-non-exhaustive

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 13, 2026

Copy link
Copy Markdown

Fixes #3479.

With --external-sources, a command substitution whose last pipeline element resolves to a sourced file (e.g. x=$(source lib.sh)) makes checkExpansionWithRedirection call its local checkCmd with a T_SourceCommand rather than a T_Redirecting, and the single-clause checkCmd then aborts with "Non-exhaustive patterns in function checkCmd". This adds the missing catch-all so non-redirecting commands are simply ignored.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Non-exhaustive patterns in function checkCmd" error

1 participant